Compositional Language Engineering Using Generated, Extensible, Static Type-Safe Visitors

نویسندگان

  • Robert Heim
  • Pedram Mir Seyed Nazari
  • Bernhard Rumpe
  • Andreas Wortmann
چکیده

Language workbenches usually produce infrastructure to represent models as abstract syntax trees (AST) and employ processing infrastructure largely based on visitors. The visitor pattern suffers from the expression problem regarding extensibility and reuse. Current approaches either forsake static type safety, require features unavailable in popular object-oriented languages (e.g., open classes), or rely on procedural abstraction and thereby give up the object-oriented data encapsulation (the AST) itself. Our approach to visitors exploits knowledge about the AST and generation of statically type-safe external visitor interfaces that support extensibility in two dimensions: (1) defining new operations by implementing the interface and (2) extending the underlying data structure, usually without requiring adaptation of existing implemented visitors. We present a concept of visitor development for language engineering that enables an adaptable traversal and provides hook points for implementing concrete visitors. This approach is applicable to single DSLs and to language composition. It thus enables a transparent, easy to use, and static type-safe solution for the typical use cases of language processing.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Type Safe Extensible Programming

Software products evolve over time. Sometimes they evolve by adding new features, and sometimes by either fixing bugs or replacing outdated implementations with new ones. When software engineers fail to anticipate such evolution during development, they will eventually be forced to re-architect or re-build from scratch. Therefore, it has been common practice to prepare for changes so that softw...

متن کامل

BON-CASE: An Extensible CASE Tool for Formal Specification and Reasoning

We describe BON-CASE, an extensible tool for the BON modelling language. The tool’s support for formal techniques – in particular, for formal specification of contracts and frames, as a platform for verification of Eiffel code, for lightweight integration with existing reasoning tools (such as type checkers, theorem provers, and static assertion checkers), and its extensible architecture – is d...

متن کامل

EVF: An Extensible and Expressive Visitor Framework for Programming Language Reuse

Object Algebras are a design pattern that enables extensibility, modularity, and reuse in mainstream object-oriented languages such as Java. The theoretical foundations of Object Algebras are rooted on Church encodings of datatypes, which are in turn closely related to folds in functional programming. Unfortunately, it is well-known that certain programs are difficult to write and may incur per...

متن کامل

Extensible type checker for parser generation

Parser generators generate translators from language specifications. In many cases, such specifications contain semantic actions written in the same language as the generated code. Since these actions are subject to little static checking, they are usually a source of errors which are discovered only when generated code is compiled. In this paper we propose a parser generator front-end which st...

متن کامل

überSpark: Enforcing Verifiable Object Abstractions for Automated Compositional Security Analysis of a Hypervisor

We present überSpark (üSpark), an innovative architecture for compositional verification of security properties of extensible hypervisors written in C and Assembly. üSpark comprises two key ideas: (i) endowing low-level system software with abstractions found in higher-level languages (e.g., objects, interfaces, function-call semantics for implementations of interfaces, access control on interf...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2016